package com.newenergy.light.ble;

import android.content.Context;
import android.widget.Toast;

import com.newenergy.light.Helper.SPUtil;


/**
 * Created by jnl on 2017/6/15.
 */

public class LightManager {
    private static Context sContext;
    private AdvertiserManager mAdvertiserManager;
    public static int deleteType = 1;


    /**
     * 获取单例
     *
     * @return
     */
    public static LightManager getInstance(Context context) {
        sContext = context.getApplicationContext();
        return Wrapper.instance;
    }

    private LightManager(Context context) {
        mAdvertiserManager = AdvertiserManager.getInstance();
        SPUtil.init(context);
    }


    static class Wrapper {
        private static LightManager instance;

        static {
            instance = new LightManager(sContext);
        }
    }

    public void toast(String toastMessage) {
        Toast.makeText(sContext, toastMessage, Toast.LENGTH_SHORT)
                .show();
    }

    /**
     * 开启扫描
     */
    public void startScan() {
        mAdvertiserManager.startScan();
    }

    /**
     * 停止扫描
     */
    public void stopScan() {
        mAdvertiserManager.stopScan();
    }



}
